﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ServiceModel.DomainServices.Server;
using System.ServiceModel.DomainServices.Hosting;

namespace Imtihan.Web
{
    public partial class ImtihanDomainService
    {
        public List<UserAnswer> GetUserAnswerByProblemAndUserId(Guid problemId, string userId)
        {
            var userAnswers = from entities in this.ObjectContext.UserAnswers
                          where entities.ProblemId == problemId && entities.UserId.ToLower() == userId.ToLower()
                          select entities;

            return userAnswers.ToList();
        }
    }
}